function checkAdminLogin()
{
    document.getElementById('adminSubmitLogin').disabled = false;
       }


function askConfirmation()
{
    var r = confirm("Continue?");
    if (r == true)
    {
      return true;
    }
    else
      return false;
}


function validateProductManager()
{   
    var formReset = new Array(3);
    var noError = 2;
    var count = 2;
    for(count = 1; count >= 0; count--)
        {
            formReset[count] = 0;
        }
    
    if (document.createProductManager.username.value != "Username"
                && document.createProductManager.username.value.length >= 8)
            {
                formReset[0] = 1; 
                document.createProductManager.username.style.backgroundColor = "#ffffff";
            }
            else
                {
                    formReset[0] = 0; 
                    document.createProductManager.username.style.backgroundColor = "#fdff76";
                }
    
                    
     if (document.createProductManager.password.value != "Password"
                && document.createProductManager.password.value.length >= 8
                && document.createProductManager.password2.value != "Retype Password"
                && document.createProductManager.password2.value.length >= 8
                && document.createProductManager.password.value == document.createProductManager.password2.value)
            {
                formReset[1] = 1; 
                document.createProductManager.password.style.backgroundColor = "#ffffff";
                document.createProductManager.password2.style.backgroundColor = "#ffffff";
           
            }
            else
                {
                    formReset[1] = 0; 
                    document.createProductManager.password.style.backgroundColor = "#fdff76";
                    document.createProductManager.password2.style.backgroundColor = "#fdff76";
                }
                
     for(count = 1; count >= 0; count--)
        {
            noError = noError - formReset[count];
        }
    
    if(noError == 0)
        {
            return askConfirmation();
        }
    else
        {
            alert("Please check values.");
            return false;
        }
    
}

function validateAccountingManager()
{   
    var formReset = new Array(3);
    var noError = 2;
    var count = 2;
    for(count = 1; count >= 0; count--)
        {
            formReset[count] = 0;
        }
    
    if (document.createProductManager.username.value != "Username"
                && document.createAccountingManager.username.value.length >= 8)
            {
                formReset[0] = 1; 
                document.createAccountingManager.username.style.backgroundColor = "#ffffff";
            }
            else
                {
                    formReset[0] = 0; 
                    document.createAccountingManager.username.style.backgroundColor = "#fdff76";
                }
    
                    
     if (document.createAccountingManager.password.value != "Password"
                && document.createAccountingManager.password.value.length >= 8
                && document.createAccountingManager.password2.value != "Retype Password"
                && document.createAccountingManager.password2.value.length >= 8
                && document.createAccountingManager.password.value == document.createAccountingManager.password2.value)
            {
                formReset[1] = 1; 
                document.createAccountingManager.password.style.backgroundColor = "#ffffff";
                document.createAccountingManager.password2.style.backgroundColor = "#ffffff";
           
            }
            else
                {
                    formReset[1] = 0; 
                    document.createAccountingManager.password.style.backgroundColor = "#fdff76";
                    document.createAccountingManager.password2.style.backgroundColor = "#fdff76";
                }
                
     for(count = 1; count >= 0; count--)
        {
            noError = noError - formReset[count];
        }
    
    if(noError == 0)
        {
            return askConfirmation();
        }
    else
        {
            alert("Please check values.");
            return false;
        }
    
}




